<template>
  <!-- <uni-card title="订单被取消" sub-title="2020.07.08" extra="详情" @touchend="handleSwitch">
    <text>摄像头维修订单，雇主取消了订单</text>
  </uni-card> -->

  <uni-card v-for="message in worker_messages" v-bind="message" :title="message.title" extra="详情"
    @touchend="handleSwitch(message._id)">
    {{ message.content }}
  </uni-card>
</template>

<script setup>
import { computed } from 'vue';
import { useMessagesStore } from '../../stores/messages';

const allMessages = useMessagesStore()
allMessages.getOrders()
const worker_messages = computed(() => {
  return allMessages.messages.filter(m => m.type === 1)
})

function handleSwitch(id) {
  uni.navigateTo({ url: "/pages/detailed_information/detailed_information?id=" + id });
}
</script>